//
//  SDImage.h
//  SKinDiary
//
//  Created by pcyang on 16/6/26.
//  Copyright © 2016年 tencent. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface SDImage : UIImage

@end

UIImage* SDGetImageByName(NSString* imageName);

@interface UIImage(SDOperation)
+ (UIImage*)imageNamedWithoutCache:(NSString*)imageName;
- (UIImage*)imageWithNewWidth:(CGFloat)width;
- (UIImage*)imageOriginRect:(CGRect)cutRect newSize:(CGSize)newSize;
- (UIImage*)imageOriginRect:(CGRect)cutRect scaled:(CGFloat)scaled rotated:(CGFloat)angle;
- (UIImage*)subImageWithRect:(CGRect)rect;

+ (UIImage *)imageWithColor:(UIColor *)color;

- (UIImage*)decodedImage;

- (UIImage*)imageWithNewHeight:(CGFloat)height;
+ (UIImage*)imageFromView:(CALayer*)layer;
+ (UIImage *)reSizeImage:(UIImage *)image toSize:(CGSize)reSize;
- (UIImage *)resizableImageWithCapInsetsEx:(UIEdgeInsets)capInsets;
-(UIImage*) stretchNineImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight;

+ (UIImage *)imageWithImage:(UIImage *)image scaledToMaxWidth:(CGFloat)width maxHeight:(CGFloat)height;
+(UIImage*)imageWithImage: (UIImage*) sourceImage scaledToWidth: (float) i_width;
- (void)drawInRectOptimized:(CGRect)rect;
- (UIImage *)drawImage:(UIImage *)inputImage inRect:(CGRect)frame ;
@end


@interface UIImage (SELF_DEFINED)
+ (UIImage*)staticImageWithName:(NSString*)name;
+ (UIImage*)staticImageWithPath:(NSString*)path;
@end
